import { fileURLToPath, URL } from "node:url";

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  base: process.env.NODE_ENV === 'production' ? './' : '/',
  publicDir:'public',
  cacheDir: 'node_modules/.vite',

  server: {
    port: 6161,
  },
  resolve: {
    alias: {
      "@": fileURLToPath(new URL("./src", import.meta.url)),
      'views':fileURLToPath(new URL("./src/views", import.meta.url)),
      'utils':fileURLToPath(new URL("./src/utils", import.meta.url)),
    },
  },
  // 构建输出配置
  build: {
    outDir: './dist',
    target: 'modules',
    assetsDir: 'assets',
    assetsInlineLimit: 360000,
  }
});
